﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎</title>

<style>
body{
	background:url(/images/6DB8B17C1C3CF7E0A912A43D5972316C.JPG) fixed center no-repeat #000;
	color:white;
}
#main-page{ 
   width:932px;  
   height:286px;  
   position:absolute;  
   left:30%;  
   top:40%;  
   margin:-100px 0 0 -150px;
}
button.in-stu{
	background: -webkit-linear-gradient(left, #0f0 , #3cf); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(right, #0f0 , #3cf); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(right, #0f0 , #3cf); /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, #0f0 , #3cf); /* 标准的语法 */
	height:200px;
	width:300px;
	font-size:36px;
}
button.in-tea{
	background: -webkit-linear-gradient(left, #3cf , #0f0); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(right, #3cf , #0f0); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(right, #3cf , #0f0); /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, #3cf , #0f0); /* 标准的语法 */
	height:200px;
	width:300px;
	font-size:36px;
	margin-left:100px;
}
.in{
	border:3px solid #000;
	padding:0;
}
.hidden{display:none;}
h1{
	font-family:黑体;
	text-align:center;
	background: #fff;
	margin: 0px;
	top: 0px;
	right:0px;
	width: 100%;
	color: #000;
	position: absolute;
	height:1.1em;
}
img{
	float:left;
	height:1em;
}
.n:hover{
	border:1px solid #abcff3;
	box-shadow:inset 0px 0px 5px #abcff3;
	height:32px;
}

.n:focus{
	border:1px solid #6b9bdc;
	box-shadow:inset 0px 0px 5px #6b9bdc;
	height:32px;
}

.b{
	height:30px;
	width:50%;
}
.n{
	height:30px;
	width:50%;
}
.c{
	height:30px;
	width:23.333%;
}
center{
	margin-top:100px;
}
input[type="submit"]{
	height:30px;
	width:50%;
	background: -webkit-linear-gradient(left, #3cf , #0f0); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(right, #3cf , #0f0); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(right, #3cf , #0f0); /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, #3cf , #0f0); /* 标准的语法 */
}
form{color:white;font-size:24px;}
@font-face {
    font-family: 'share'; 
    src: url('/images/06B3D475DDA85A7258997C4BC16A04EA.TTF');
}
.xnw,.xnw_img{
	float:right;
	height:1.1em;
	cursor:pointer;
	font-family:share;
	color:white;
	background:rgba(233,86,26,1);
}
</style>
</head>
<body>
<script>
if(history==undefined)history=new Object();
if(history.pushState==undefined)history.pushState=function(a,b,c){window.open(c);};
</script>
<!--[IF IE 5]>
<script>setTimeout("document.write('您的IE版本过低');",200);</script>
<![endif-->
<div id="main-page" class="hidden">
<button class="in in-stu">我是成员</button>
<button class="in in-tea">我是老师</button>
</div>
<div class="hidden" id="stu-login"><h1>
<img src="/images/0E4D9D5BD162A0E5AEA90EABCD689C6B.JPG" class="in-mp" />
登录
</h1><div height="38px;"></div>
<center><form id="f-stu">
<input name="user" placeholder="输入用户名" class="in-uname n b" /><br/><br/>
<input name="pass" placeholder="输入密码" class="in-pwd n b" type="password" /><br/><br/>
<input type="submit" value="登录" class="in" />
</form></center>
</div>
<div class="" id="tea-login"><h1>
<img src="/images/0E4D9D5BD162A0E5AEA90EABCD689C6B.JPG" class="in-mp" />
登录<span class="xnw">分享到<img src="images/FBDFA6B09FBD2BED9FFCC0FCC8487558.PNG" class="xnw_img" /></span>
</h1>
<center><form id="f-tea">
尊敬的老师：<br/>您好！<br/>请输入您的<input name="user" placeholder="电子邮件(xxx@rdfz.cn)" class="in-uname n c" type="email" pattern="\w+([-+.]\w+)*@rdfz.cn$" />并输入您想查询的
<select name="pass" class="in-pwd n c">
<option>班级号</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
<option>13</option>
<option>14</option></select>，谢谢合作！！！<br/><br/>
<input type="submit" value="登录" class="in" />
</form></center>
</div>
<script>
function $(a){b=document.querySelectorAll(a);if(/#\w+/.test(a))return b[0];else return b;}
function ael(a,b,c){a.addEventListener(b,c);}
function nul(){}

uriRead = function(stu,tea,mp){
	_u=location.href;
	if(_u.indexOf('/login/stu')>-1){stu();}
	else if (_u.indexOf('/login/tea')>-1){tea();}
	else{mp();}
}
inStuHandler = function(){
	$('#main-page').classList.add('hidden');
	$('#stu-login').classList.remove('hidden');
	$('#tea-login').classList.add('hidden');
	function a(){history.pushState([],'',"/login/stu/");}
	uriRead(nul,a,a);
}
inTeaHandler = function(){
	$('#main-page').classList.add('hidden');
	$('#stu-login').classList.add('hidden');
	$('#tea-login').classList.remove('hidden');
	function a(){history.pushState([],'',"/login/tea/");}
	uriRead(a,nul,a);
}
MPHandler = function(){
	$('#main-page').classList.remove('hidden');
	$('#stu-login').classList.add('hidden');
	$('#tea-login').classList.add('hidden');
	function a(){history.pushState([],'',"/");}
	uriRead(a,a,nul);
}
ael($(".in-stu")[0],'click',inStuHandler);
ael($(".in-tea")[0],'click',inTeaHandler);
ael($(".in-mp")[0],'click',MPHandler);
ael($(".in-mp")[1],'click',MPHandler);
window._ops=window.onpopstate;
window.onpopstate=function(){
uriRead(inStuHandler,inTeaHandler,MPHandler);	
};
var xnw = function() {
    function getlen(str) {
        var finalen = len = str.length;
        for (var j = 0; j < len; j++) {
            if (str.charCodeAt(j) >= 255) {
                finalen++;
            }
        }
        return finalen;
    }
    function jiequ(str, num) {
        var count = 0,
        len = str.length;
        for (var place = 1; place <= len; place++) {
            if (str.charCodeAt(i - 1) >= 255) {
                count += 2;
            } else {
                count++;
            }
            if (count == num) {
                return place;
            } else {
                if (count > num) {
                    return place - 1;
                }
            }
        }
        return place - 1;
    }
    window.open_window = function(k) {
        var url = ["http://xnw.com/share/share.php?title=", encodeURIComponent(selectedW), "&url=", encodeURIComponent(location.href), "&imghref=", encodeURIComponent(imgstr)].join("");
        var params = ["toolbar=0,status=0,resizable=1,width=675,height=480,left=", (screen.width - 440) / 2, ",top=", (screen.height - 430) / 2].join("");
        if (!window.open(url, "mb", params)) {
            location = url;
        }
    };
    var selectedW = (function() {/*
        if (window.getSelection) {
            return window.getSelection().toString();
        } else {
            if (document.getSelection) {
                return document.getSelection();
            } else {
                if (document.selection) {
                    return document.selection.createRange().text;
                } else {
                    return "";
                }
            }
        }*/return prompt("请输入分享内容","学生会成绩查询");
    })().replace(/^\s+|\s+$/g, "");
    var imglist = document.getElementsByTagName("img"),
    i,
    imgcount = imglist.length;
    window.img_list = [];
    for (i = 0; i < imgcount; i++) {
        if (imglist[i].width > 200 && imglist.className!="xnw_img") {
            img_list.push(imglist[i].src);
        }
    }
    if (!selectedW) {
        selectedW = "分享：" + '学生会成绩查询';
    } else {
        selectedW = "分享：" + selectedW;
    }
    var strlen = getlen(selectedW),
    imgstr = img_list.slice(0, 25).join("*");
    if (strlen > 100) {
        selectedW = selectedW.slice(0, jiequ(selectedW, 100)); + "…"
    }
    if (/Firefox/i.test(navigator.userAgent)) {
        setTimeout(function() {
            open_window(imgstr);
        },
        0);
    } else {
        open_window(imgstr);
    }
};
ael($('.xnw')[0],'click',xnw);
function addfav(sURL,sTitle)
{
	try
    {
        window.external.addFavorite(sURL, sTitle);
    }
    catch (e)
    {
        try
        {
            window.sidebar.addPanel(sTitle, sURL, "");
        }
        catch (e)
        {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }

 }
</script>
</body>
</html>
